package com.example.job.controller;

import com.example.job.JobApplication;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
public class Job {

    private static Logger logger = LogManager.getLogger(JobApplication.class);

    @Scheduled(cron = "0/2 * * * * ? ") // 间隔2秒执行
    public void fixedDelayJob(){
        logger.info(String.valueOf(System.currentTimeMillis()));
    }

}
